#!/bin/sh
# Copyright 2009-2011,2015-2016 BitMover, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# This is BitKeeper's way of coming up with a platform identifier.  If
# you run bk version you'll see the output of this command.  We find
# it useful and maybe you will as well.
#
# We start with the GNU config.guess script that digs out versions
# like i686-pc-linux and then we dig out libc information and convert 
# that to something like x86-glibc27-linux.  That's the main value-add
# of this script, it gives you a string that is libc specific in most
# cases.  I'm sort of surprised the GNU config.guess doesn't have an
# option to do this, maybe it will some day.
#
# Some of the choices we made here may not be right for you.  We're a
# software vendor and the results of this script reflect what we want
# our customers to do.  For example, we print out very specific information
# about linux so they can match their libc exactly.  Ditto for freebsd.
# That's because those platforms are funky about compatibility.  On the
# other hand, we compile on old versions of solaris and they are very
# good about compatibility so we strip the OS release number there.
#
# The point is that you may want to tweak this a bit, your needs may be
# different than ours.
#
# The non-gnu stuff is copyright (c) 1999-2015 BitKeeper Inc. and is not
# GPL-ed because these parts are reasonably separable (see GNU GPL Section 2).
# The BitKeeper part is everything after "^SHAR_EOF" and is available under
# the BSD license, have the big fun.  If you are the license police and
# want us to say that you can have it under the GPL or whatever, that's
# fine, just ask and it's 99.9% certain we'll give you what you want.

sed 's/^X//' << 'SHAR_EOF' > /tmp/gnu-os$$ 
#! /bin/sh
# Attempt to guess a canonical system name.
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
#   2011 Free Software Foundation, Inc.
X
timestamp='2011-02-02'
X
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
X
X
# Originally written by Per Bothner.  Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub.  If it succeeds, it prints the system name on stdout, and
# exits with 0.  Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
X
me=`echo "$0" | sed -e 's,.*/,,'`
X
usage="\
Usage: $0 [OPTION]
X
Output the configuration name of the system \`$me' is run on.
X
Operation modes:
X  -h, --help         print this help, then exit
X  -t, --time-stamp   print date of last modification, then exit
X  -v, --version      print version number, then exit
X
Report bugs and patches to <config-patches@gnu.org>."
X
version="\
GNU config.guess ($timestamp)
X
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
Software Foundation, Inc.
X
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
X
help="
Try \`$me --help' for more information."
X
# Parse command line
while test $# -gt 0 ; do
X  case $1 in
X    --time-stamp | --time* | -t )
X       echo "$timestamp" ; exit ;;
X    --version | -v )
X       echo "$version" ; exit ;;
X    --help | --h* | -h )
X       echo "$usage"; exit ;;
X    -- )     # Stop option processing
X       shift; break ;;
X    - )	# Use stdin as input.
X       break ;;
X    -* )
X       echo "$me: invalid option $1$help" >&2
X       exit 1 ;;
X    * )
X       break ;;
X  esac
done
X
if test $# != 0; then
X  echo "$me: too many arguments$help" >&2
X  exit 1
fi
X
trap 'exit 1' 1 2 15
X
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
X
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
X
# Portable tmp directory creation inspired by the Autoconf team.
X
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
X { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
X { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
X { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
X { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
X ,,)    echo "int x;" > $dummy.c ;
X	for c in cc gcc c89 c99 ; do
X	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
X	     CC_FOR_BUILD="$c"; break ;
X	  fi ;
X	done ;
X	if test x"$CC_FOR_BUILD" = x ; then
X	  CC_FOR_BUILD=no_compiler_found ;
X	fi
X	;;
X ,,*)   CC_FOR_BUILD=$CC ;;
X ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
X
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
X	PATH=$PATH:/.attbin ; export PATH
fi
X
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
X
# Note: order is significant - the case branches are not exclusive.
X
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
X    *:NetBSD:*:*)
X	# NetBSD (nbsd) targets should (where applicable) match one or
X	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
X	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
X	# switched to ELF, *-*-netbsd* would select the old
X	# object file format.  This provides both forward
X	# compatibility and a consistent mechanism for selecting the
X	# object file format.
X	#
X	# Note: NetBSD doesn't particularly care about the vendor
X	# portion of the name.  We always set it to "unknown".
X	sysctl="sysctl -n hw.machine_arch"
X	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
X	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
X	case "${UNAME_MACHINE_ARCH}" in
X	    armeb) machine=armeb-unknown ;;
X	    arm*) machine=arm-unknown ;;
X	    sh3el) machine=shl-unknown ;;
X	    sh3eb) machine=sh-unknown ;;
X	    sh5el) machine=sh5le-unknown ;;
X	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
X	esac
X	# The Operating System including object format, if it has switched
X	# to ELF recently, or will in the future.
X	case "${UNAME_MACHINE_ARCH}" in
X	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
X		eval $set_cc_for_build
X		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
X			| grep -q __ELF__
X		then
X		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
X		    # Return netbsd for either.  FIX?
X		    os=netbsd
X		else
X		    os=netbsdelf
X		fi
X		;;
X	    *)
X		os=netbsd
X		;;
X	esac
X	# The OS release
X	# Debian GNU/NetBSD machines have a different userland, and
X	# thus, need a distinct triplet. However, they do not need
X	# kernel version information, so it can be replaced with a
X	# suitable tag, in the style of linux-gnu.
X	case "${UNAME_VERSION}" in
X	    Debian*)
X		release='-gnu'
X		;;
X	    *)
X		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
X		;;
X	esac
X	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
X	# contains redundant information, the shorter form:
X	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
X	echo "${machine}-${os}${release}"
X	exit ;;
X    *:OpenBSD:*:*)
X	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
X	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
X	exit ;;
X    *:ekkoBSD:*:*)
X	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
X	exit ;;
X    *:SolidBSD:*:*)
X	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
X	exit ;;
X    macppc:MirBSD:*:*)
X	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
X	exit ;;
X    *:MirBSD:*:*)
X	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
X	exit ;;
X    alpha:OSF1:*:*)
X	case $UNAME_RELEASE in
X	*4.0)
X		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
X		;;
X	*5.*)
X		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
X		;;
X	esac
X	# According to Compaq, /usr/sbin/psrinfo has been available on
X	# OSF/1 and Tru64 systems produced since 1995.  I hope that
X	# covers most systems running today.  This code pipes the CPU
X	# types through head -n 1, so we only detect the type of CPU 0.
X	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
X	case "$ALPHA_CPU_TYPE" in
X	    "EV4 (21064)")
X		UNAME_MACHINE="alpha" ;;
X	    "EV4.5 (21064)")
X		UNAME_MACHINE="alpha" ;;
X	    "LCA4 (21066/21068)")
X		UNAME_MACHINE="alpha" ;;
X	    "EV5 (21164)")
X		UNAME_MACHINE="alphaev5" ;;
X	    "EV5.6 (21164A)")
X		UNAME_MACHINE="alphaev56" ;;
X	    "EV5.6 (21164PC)")
X		UNAME_MACHINE="alphapca56" ;;
X	    "EV5.7 (21164PC)")
X		UNAME_MACHINE="alphapca57" ;;
X	    "EV6 (21264)")
X		UNAME_MACHINE="alphaev6" ;;
X	    "EV6.7 (21264A)")
X		UNAME_MACHINE="alphaev67" ;;
X	    "EV6.8CB (21264C)")
X		UNAME_MACHINE="alphaev68" ;;
X	    "EV6.8AL (21264B)")
X		UNAME_MACHINE="alphaev68" ;;
X	    "EV6.8CX (21264D)")
X		UNAME_MACHINE="alphaev68" ;;
X	    "EV6.9A (21264/EV69A)")
X		UNAME_MACHINE="alphaev69" ;;
X	    "EV7 (21364)")
X		UNAME_MACHINE="alphaev7" ;;
X	    "EV7.9 (21364A)")
X		UNAME_MACHINE="alphaev79" ;;
X	esac
X	# A Pn.n version is a patched version.
X	# A Vn.n version is a released version.
X	# A Tn.n version is a released field test version.
X	# A Xn.n version is an unreleased experimental baselevel.
X	# 1.2 uses "1.2" for uname -r.
X	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
X	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
X	exitcode=$?
X	trap '' 0
X	exit $exitcode ;;
X    Alpha\ *:Windows_NT*:*)
X	# How do we know it's Interix rather than the generic POSIX subsystem?
X	# Should we change UNAME_MACHINE based on the output of uname instead
X	# of the specific Alpha model?
X	echo alpha-pc-interix
X	exit ;;
X    21064:Windows_NT:50:3)
X	echo alpha-dec-winnt3.5
X	exit ;;
X    Amiga*:UNIX_System_V:4.0:*)
X	echo m68k-unknown-sysv4
X	exit ;;
X    *:[Aa]miga[Oo][Ss]:*:*)
X	echo ${UNAME_MACHINE}-unknown-amigaos
X	exit ;;
X    *:[Mm]orph[Oo][Ss]:*:*)
X	echo ${UNAME_MACHINE}-unknown-morphos
X	exit ;;
X    *:OS/390:*:*)
X	echo i370-ibm-openedition
X	exit ;;
X    *:z/VM:*:*)
X	echo s390-ibm-zvmoe
X	exit ;;
X    *:OS400:*:*)
X	echo powerpc-ibm-os400
X	exit ;;
X    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
X	echo arm-acorn-riscix${UNAME_RELEASE}
X	exit ;;
X    arm:riscos:*:*|arm:RISCOS:*:*)
X	echo arm-unknown-riscos
X	exit ;;
X    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
X	echo hppa1.1-hitachi-hiuxmpp
X	exit ;;
X    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
X	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
X	if test "`(/bin/universe) 2>/dev/null`" = att ; then
X		echo pyramid-pyramid-sysv3
X	else
X		echo pyramid-pyramid-bsd
X	fi
X	exit ;;
X    NILE*:*:*:dcosx)
X	echo pyramid-pyramid-svr4
X	exit ;;
X    DRS?6000:unix:4.0:6*)
X	echo sparc-icl-nx6
X	exit ;;
X    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
X	case `/usr/bin/uname -p` in
X	    sparc) echo sparc-icl-nx7; exit ;;
X	esac ;;
X    s390x:SunOS:*:*)
X	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    sun4H:SunOS:5.*:*)
X	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
X	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
X	echo i386-pc-auroraux${UNAME_RELEASE}
X	exit ;;
X    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
X	eval $set_cc_for_build
X	SUN_ARCH="i386"
X	# If there is a compiler, see if it is configured for 64-bit objects.
X	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
X	# This test works for both compilers.
X	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
X	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
X		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
X		grep IS_64BIT_ARCH >/dev/null
X	    then
X		SUN_ARCH="x86_64"
X	    fi
X	fi
X	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    sun4*:SunOS:6*:*)
X	# According to config.sub, this is the proper way to canonicalize
X	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
X	# it's likely to be more like Solaris than SunOS4.
X	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    sun4*:SunOS:*:*)
X	case "`/usr/bin/arch -k`" in
X	    Series*|S4*)
X		UNAME_RELEASE=`uname -v`
X		;;
X	esac
X	# Japanese Language versions have a version number like `4.1.3-JL'.
X	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
X	exit ;;
X    sun3*:SunOS:*:*)
X	echo m68k-sun-sunos${UNAME_RELEASE}
X	exit ;;
X    sun*:*:4.2BSD:*)
X	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
X	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
X	case "`/bin/arch`" in
X	    sun3)
X		echo m68k-sun-sunos${UNAME_RELEASE}
X		;;
X	    sun4)
X		echo sparc-sun-sunos${UNAME_RELEASE}
X		;;
X	esac
X	exit ;;
X    aushp:SunOS:*:*)
X	echo sparc-auspex-sunos${UNAME_RELEASE}
X	exit ;;
X    # The situation for MiNT is a little confusing.  The machine name
X    # can be virtually everything (everything which is not
X    # "atarist" or "atariste" at least should have a processor
X    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
X    # to the lowercase version "mint" (or "freemint").  Finally
X    # the system name "TOS" denotes a system which is actually not
X    # MiNT.  But MiNT is downward compatible to TOS, so this should
X    # be no problem.
X    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
X	echo m68k-atari-mint${UNAME_RELEASE}
X	exit ;;
X    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
X	echo m68k-atari-mint${UNAME_RELEASE}
X	exit ;;
X    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
X	echo m68k-atari-mint${UNAME_RELEASE}
X	exit ;;
X    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
X	echo m68k-milan-mint${UNAME_RELEASE}
X	exit ;;
X    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
X	echo m68k-hades-mint${UNAME_RELEASE}
X	exit ;;
X    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
X	echo m68k-unknown-mint${UNAME_RELEASE}
X	exit ;;
X    m68k:machten:*:*)
X	echo m68k-apple-machten${UNAME_RELEASE}
X	exit ;;
X    powerpc:machten:*:*)
X	echo powerpc-apple-machten${UNAME_RELEASE}
X	exit ;;
X    RISC*:Mach:*:*)
X	echo mips-dec-mach_bsd4.3
X	exit ;;
X    RISC*:ULTRIX:*:*)
X	echo mips-dec-ultrix${UNAME_RELEASE}
X	exit ;;
X    VAX*:ULTRIX*:*:*)
X	echo vax-dec-ultrix${UNAME_RELEASE}
X	exit ;;
X    2020:CLIX:*:* | 2430:CLIX:*:*)
X	echo clipper-intergraph-clix${UNAME_RELEASE}
X	exit ;;
X    mips:*:*:UMIPS | mips:*:*:RISCos)
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h>  /* for printf() prototype */
X	int main (int argc, char *argv[]) {
#else
X	int main (argc, argv) int argc; char *argv[]; {
#endif
X	#if defined (host_mips) && defined (MIPSEB)
X	#if defined (SYSTYPE_SYSV)
X	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
X	#endif
X	#if defined (SYSTYPE_SVR4)
X	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
X	#endif
X	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
X	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
X	#endif
X	#endif
X	  exit (-1);
X	}
EOF
X	$CC_FOR_BUILD -o $dummy $dummy.c &&
X	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
X	  SYSTEM_NAME=`$dummy $dummyarg` &&
X	    { echo "$SYSTEM_NAME"; exit; }
X	echo mips-mips-riscos${UNAME_RELEASE}
X	exit ;;
X    Motorola:PowerMAX_OS:*:*)
X	echo powerpc-motorola-powermax
X	exit ;;
X    Motorola:*:4.3:PL8-*)
X	echo powerpc-harris-powermax
X	exit ;;
X    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
X	echo powerpc-harris-powermax
X	exit ;;
X    Night_Hawk:Power_UNIX:*:*)
X	echo powerpc-harris-powerunix
X	exit ;;
X    m88k:CX/UX:7*:*)
X	echo m88k-harris-cxux7
X	exit ;;
X    m88k:*:4*:R4*)
X	echo m88k-motorola-sysv4
X	exit ;;
X    m88k:*:3*:R3*)
X	echo m88k-motorola-sysv3
X	exit ;;
X    AViiON:dgux:*:*)
X	# DG/UX returns AViiON for all architectures
X	UNAME_PROCESSOR=`/usr/bin/uname -p`
X	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
X	then
X	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
X	       [ ${TARGET_BINARY_INTERFACE}x = x ]
X	    then
X		echo m88k-dg-dgux${UNAME_RELEASE}
X	    else
X		echo m88k-dg-dguxbcs${UNAME_RELEASE}
X	    fi
X	else
X	    echo i586-dg-dgux${UNAME_RELEASE}
X	fi
X	exit ;;
X    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
X	echo m88k-dolphin-sysv3
X	exit ;;
X    M88*:*:R3*:*)
X	# Delta 88k system running SVR3
X	echo m88k-motorola-sysv3
X	exit ;;
X    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
X	echo m88k-tektronix-sysv3
X	exit ;;
X    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
X	echo m68k-tektronix-bsd
X	exit ;;
X    *:IRIX*:*:*)
X	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
X	exit ;;
X    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
X	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
X	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
X    i*86:AIX:*:*)
X	echo i386-ibm-aix
X	exit ;;
X    ia64:AIX:*:*)
X	if [ -x /usr/bin/oslevel ] ; then
X		IBM_REV=`/usr/bin/oslevel`
X	else
X		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
X	fi
X	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
X	exit ;;
X    *:AIX:2:3)
X	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
X		eval $set_cc_for_build
X		sed 's/^		//' << EOF >$dummy.c
X		#include <sys/systemcfg.h>
X
X		main()
X			{
X			if (!__power_pc())
X				exit(1);
X			puts("powerpc-ibm-aix3.2.5");
X			exit(0);
X			}
EOF
X		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
X		then
X			echo "$SYSTEM_NAME"
X		else
X			echo rs6000-ibm-aix3.2.5
X		fi
X	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
X		echo rs6000-ibm-aix3.2.4
X	else
X		echo rs6000-ibm-aix3.2
X	fi
X	exit ;;
X    *:AIX:*:[4567])
X	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
X	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
X		IBM_ARCH=rs6000
X	else
X		IBM_ARCH=powerpc
X	fi
X	if [ -x /usr/bin/oslevel ] ; then
X		IBM_REV=`/usr/bin/oslevel`
X	else
X		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
X	fi
X	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
X	exit ;;
X    *:AIX:*:*)
X	echo rs6000-ibm-aix
X	exit ;;
X    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
X	echo romp-ibm-bsd4.4
X	exit ;;
X    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
X	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
X	exit ;;                             # report: romp-ibm BSD 4.3
X    *:BOSX:*:*)
X	echo rs6000-bull-bosx
X	exit ;;
X    DPX/2?00:B.O.S.:*:*)
X	echo m68k-bull-sysv3
X	exit ;;
X    9000/[34]??:4.3bsd:1.*:*)
X	echo m68k-hp-bsd
X	exit ;;
X    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
X	echo m68k-hp-bsd4.4
X	exit ;;
X    9000/[34678]??:HP-UX:*:*)
X	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
X	case "${UNAME_MACHINE}" in
X	    9000/31? )            HP_ARCH=m68000 ;;
X	    9000/[34]?? )         HP_ARCH=m68k ;;
X	    9000/[678][0-9][0-9])
X		if [ -x /usr/bin/getconf ]; then
X		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
X		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
X		    case "${sc_cpu_version}" in
X		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
X		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
X		      532)                      # CPU_PA_RISC2_0
X			case "${sc_kernel_bits}" in
X			  32) HP_ARCH="hppa2.0n" ;;
X			  64) HP_ARCH="hppa2.0w" ;;
X			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
X			esac ;;
X		    esac
X		fi
X		if [ "${HP_ARCH}" = "" ]; then
X		    eval $set_cc_for_build
X		    sed 's/^		//' << EOF >$dummy.c
X
X		#define _HPUX_SOURCE
X		#include <stdlib.h>
X		#include <unistd.h>
X
X		int main ()
X		{
X		#if defined(_SC_KERNEL_BITS)
X		    long bits = sysconf(_SC_KERNEL_BITS);
X		#endif
X		    long cpu  = sysconf (_SC_CPU_VERSION);
X
X		    switch (cpu)
X			{
X			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
X			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
X			case CPU_PA_RISC2_0:
X		#if defined(_SC_KERNEL_BITS)
X			    switch (bits)
X				{
X				case 64: puts ("hppa2.0w"); break;
X				case 32: puts ("hppa2.0n"); break;
X				default: puts ("hppa2.0"); break;
X				} break;
X		#else  /* !defined(_SC_KERNEL_BITS) */
X			    puts ("hppa2.0"); break;
X		#endif
X			default: puts ("hppa1.0"); break;
X			}
X		    exit (0);
X		}
EOF
X		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
X		    test -z "$HP_ARCH" && HP_ARCH=hppa
X		fi ;;
X	esac
X	if [ ${HP_ARCH} = "hppa2.0w" ]
X	then
X	    eval $set_cc_for_build
X
X	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
X	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
X	    # generating 64-bit code.  GNU and HP use different nomenclature:
X	    #
X	    # $ CC_FOR_BUILD=cc ./config.guess
X	    # => hppa2.0w-hp-hpux11.23
X	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
X	    # => hppa64-hp-hpux11.23
X
X	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
X		grep -q __LP64__
X	    then
X		HP_ARCH="hppa2.0w"
X	    else
X		HP_ARCH="hppa64"
X	    fi
X	fi
X	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
X	exit ;;
X    ia64:HP-UX:*:*)
X	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
X	echo ia64-hp-hpux${HPUX_REV}
X	exit ;;
X    3050*:HI-UX:*:*)
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
X	#include <unistd.h>
X	int
X	main ()
X	{
X	  long cpu = sysconf (_SC_CPU_VERSION);
X	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
X	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
X	     results, however.  */
X	  if (CPU_IS_PA_RISC (cpu))
X	    {
X	      switch (cpu)
X		{
X		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
X		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
X		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
X		  default: puts ("hppa-hitachi-hiuxwe2"); break;
X		}
X	    }
X	  else if (CPU_IS_HP_MC68K (cpu))
X	    puts ("m68k-hitachi-hiuxwe2");
X	  else puts ("unknown-hitachi-hiuxwe2");
X	  exit (0);
X	}
EOF
X	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
X		{ echo "$SYSTEM_NAME"; exit; }
X	echo unknown-hitachi-hiuxwe2
X	exit ;;
X    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
X	echo hppa1.1-hp-bsd
X	exit ;;
X    9000/8??:4.3bsd:*:*)
X	echo hppa1.0-hp-bsd
X	exit ;;
X    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
X	echo hppa1.0-hp-mpeix
X	exit ;;
X    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
X	echo hppa1.1-hp-osf
X	exit ;;
X    hp8??:OSF1:*:*)
X	echo hppa1.0-hp-osf
X	exit ;;
X    i*86:OSF1:*:*)
X	if [ -x /usr/sbin/sysversion ] ; then
X	    echo ${UNAME_MACHINE}-unknown-osf1mk
X	else
X	    echo ${UNAME_MACHINE}-unknown-osf1
X	fi
X	exit ;;
X    parisc*:Lites*:*:*)
X	echo hppa1.1-hp-lites
X	exit ;;
X    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
X	echo c1-convex-bsd
X	exit ;;
X    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
X	if getsysinfo -f scalar_acc
X	then echo c32-convex-bsd
X	else echo c2-convex-bsd
X	fi
X	exit ;;
X    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
X	echo c34-convex-bsd
X	exit ;;
X    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
X	echo c38-convex-bsd
X	exit ;;
X    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
X	echo c4-convex-bsd
X	exit ;;
X    CRAY*Y-MP:*:*:*)
X	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit ;;
X    CRAY*[A-Z]90:*:*:*)
X	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
X	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
X	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
X	      -e 's/\.[^.]*$/.X/'
X	exit ;;
X    CRAY*TS:*:*:*)
X	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit ;;
X    CRAY*T3E:*:*:*)
X	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit ;;
X    CRAY*SV1:*:*:*)
X	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit ;;
X    *:UNICOS/mp:*:*)
X	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit ;;
X    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
X	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
X	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
X	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
X	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
X	exit ;;
X    5000:UNIX_System_V:4.*:*)
X	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
X	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
X	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
X	exit ;;
X    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
X	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
X	exit ;;
X    sparc*:BSD/OS:*:*)
X	echo sparc-unknown-bsdi${UNAME_RELEASE}
X	exit ;;
X    *:BSD/OS:*:*)
X	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
X	exit ;;
X    *:FreeBSD:*:*)
X	case ${UNAME_MACHINE} in
X	    pc98)
X		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
X	    amd64)
X		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
X	    *)
X		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
X	esac
X	exit ;;
X    i*:CYGWIN*:*)
X	echo ${UNAME_MACHINE}-pc-cygwin
X	exit ;;
X    *:MINGW*:*)
X	echo ${UNAME_MACHINE}-pc-mingw32
X	exit ;;
X    i*:windows32*:*)
X	# uname -m includes "-pc" on this system.
X	echo ${UNAME_MACHINE}-mingw32
X	exit ;;
X    i*:PW*:*)
X	echo ${UNAME_MACHINE}-pc-pw32
X	exit ;;
X    *:Interix*:*)
X	case ${UNAME_MACHINE} in
X	    x86)
X		echo i586-pc-interix${UNAME_RELEASE}
X		exit ;;
X	    authenticamd | genuineintel | EM64T)
X		echo x86_64-unknown-interix${UNAME_RELEASE}
X		exit ;;
X	    IA64)
X		echo ia64-unknown-interix${UNAME_RELEASE}
X		exit ;;
X	esac ;;
X    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
X	echo i${UNAME_MACHINE}-pc-mks
X	exit ;;
X    8664:Windows_NT:*)
X	echo x86_64-pc-mks
X	exit ;;
X    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
X	# How do we know it's Interix rather than the generic POSIX subsystem?
X	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
X	# UNAME_MACHINE based on the output of uname instead of i386?
X	echo i586-pc-interix
X	exit ;;
X    i*:UWIN*:*)
X	echo ${UNAME_MACHINE}-pc-uwin
X	exit ;;
X    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
X	echo x86_64-unknown-cygwin
X	exit ;;
X    p*:CYGWIN*:*)
X	echo powerpcle-unknown-cygwin
X	exit ;;
X    prep*:SunOS:5.*:*)
X	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit ;;
X    *:GNU:*:*)
X	# the GNU system
X	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
X	exit ;;
X    *:GNU/*:*:*)
X	# other systems with GNU libc and userland
X	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
X	exit ;;
X    i*86:Minix:*:*)
X	echo ${UNAME_MACHINE}-pc-minix
X	exit ;;
X    alpha:Linux:*:*)
X	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
X	  EV5)   UNAME_MACHINE=alphaev5 ;;
X	  EV56)  UNAME_MACHINE=alphaev56 ;;
X	  PCA56) UNAME_MACHINE=alphapca56 ;;
X	  PCA57) UNAME_MACHINE=alphapca56 ;;
X	  EV6)   UNAME_MACHINE=alphaev6 ;;
X	  EV67)  UNAME_MACHINE=alphaev67 ;;
X	  EV68*) UNAME_MACHINE=alphaev68 ;;
X	esac
X	objdump --private-headers /bin/sh | grep -q ld.so.1
X	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
X	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
X	exit ;;
X    arm*:Linux:*:*)
X	eval $set_cc_for_build
X	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
X	    | grep -q __ARM_EABI__
X	then
X	    echo ${UNAME_MACHINE}-unknown-linux-gnu
X	else
X	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
X	fi
X	exit ;;
X    avr32*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    cris:Linux:*:*)
X	echo cris-axis-linux-gnu
X	exit ;;
X    crisv32:Linux:*:*)
X	echo crisv32-axis-linux-gnu
X	exit ;;
X    frv:Linux:*:*)
X	echo frv-unknown-linux-gnu
X	exit ;;
X    i*86:Linux:*:*)
X	LIBC=gnu
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
X	#ifdef __dietlibc__
X	LIBC=dietlibc
X	#endif
EOF
X	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
X	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
X	exit ;;
X    ia64:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    m32r*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    m68*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    mips:Linux:*:* | mips64:Linux:*:*)
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
X	#undef CPU
X	#undef ${UNAME_MACHINE}
X	#undef ${UNAME_MACHINE}el
X	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
X	CPU=${UNAME_MACHINE}el
X	#else
X	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
X	CPU=${UNAME_MACHINE}
X	#else
X	CPU=
X	#endif
X	#endif
EOF
X	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
X	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
X	;;
X    or32:Linux:*:*)
X	echo or32-unknown-linux-gnu
X	exit ;;
X    padre:Linux:*:*)
X	echo sparc-unknown-linux-gnu
X	exit ;;
X    parisc64:Linux:*:* | hppa64:Linux:*:*)
X	echo hppa64-unknown-linux-gnu
X	exit ;;
X    parisc:Linux:*:* | hppa:Linux:*:*)
X	# Look for CPU level
X	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
X	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
X	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
X	  *)    echo hppa-unknown-linux-gnu ;;
X	esac
X	exit ;;
X    ppc64:Linux:*:*)
X	echo powerpc64-unknown-linux-gnu
X	exit ;;
X    ppc:Linux:*:*)
X	echo powerpc-unknown-linux-gnu
X	exit ;;
X    s390:Linux:*:* | s390x:Linux:*:*)
X	echo ${UNAME_MACHINE}-ibm-linux
X	exit ;;
X    sh64*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    sh*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    sparc:Linux:*:* | sparc64:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    tile*:Linux:*:*)
X	echo ${UNAME_MACHINE}-tilera-linux-gnu
X	exit ;;
X    vax:Linux:*:*)
X	echo ${UNAME_MACHINE}-dec-linux-gnu
X	exit ;;
X    x86_64:Linux:*:*)
X	echo x86_64-unknown-linux-gnu
X	exit ;;
X    xtensa*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit ;;
X    i*86:DYNIX/ptx:4*:*)
X	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
X	# earlier versions are messed up and put the nodename in both
X	# sysname and nodename.
X	echo i386-sequent-sysv4
X	exit ;;
X    i*86:UNIX_SV:4.2MP:2.*)
X	# Unixware is an offshoot of SVR4, but it has its own version
X	# number series starting with 2...
X	# I am not positive that other SVR4 systems won't match this,
X	# I just have to hope.  -- rms.
X	# Use sysv4.2uw... so that sysv4* matches it.
X	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
X	exit ;;
X    i*86:OS/2:*:*)
X	# If we were able to find `uname', then EMX Unix compatibility
X	# is probably installed.
X	echo ${UNAME_MACHINE}-pc-os2-emx
X	exit ;;
X    i*86:XTS-300:*:STOP)
X	echo ${UNAME_MACHINE}-unknown-stop
X	exit ;;
X    i*86:atheos:*:*)
X	echo ${UNAME_MACHINE}-unknown-atheos
X	exit ;;
X    i*86:syllable:*:*)
X	echo ${UNAME_MACHINE}-pc-syllable
X	exit ;;
X    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
X	echo i386-unknown-lynxos${UNAME_RELEASE}
X	exit ;;
X    i*86:*DOS:*:*)
X	echo ${UNAME_MACHINE}-pc-msdosdjgpp
X	exit ;;
X    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
X	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
X	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
X		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
X	else
X		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
X	fi
X	exit ;;
X    i*86:*:5:[678]*)
X	# UnixWare 7.x, OpenUNIX and OpenServer 6.
X	case `/bin/uname -X | grep "^Machine"` in
X	    *486*)	     UNAME_MACHINE=i486 ;;
X	    *Pentium)	     UNAME_MACHINE=i586 ;;
X	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
X	esac
X	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
X	exit ;;
X    i*86:*:3.2:*)
X	if test -f /usr/options/cb.name; then
X		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
X		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
X	elif /bin/uname -X 2>/dev/null >/dev/null ; then
X		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
X		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
X		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
X			&& UNAME_MACHINE=i586
X		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
X			&& UNAME_MACHINE=i686
X		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
X			&& UNAME_MACHINE=i686
X		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
X	else
X		echo ${UNAME_MACHINE}-pc-sysv32
X	fi
X	exit ;;
X    pc:*:*:*)
X	# Left here for compatibility:
X	# uname -m prints for DJGPP always 'pc', but it prints nothing about
X	# the processor, so we play safe by assuming i586.
X	# Note: whatever this is, it MUST be the same as what config.sub
X	# prints for the "djgpp" host, or else GDB configury will decide that
X	# this is a cross-build.
X	echo i586-pc-msdosdjgpp
X	exit ;;
X    Intel:Mach:3*:*)
X	echo i386-pc-mach3
X	exit ;;
X    paragon:*:*:*)
X	echo i860-intel-osf1
X	exit ;;
X    i860:*:4.*:*) # i860-SVR4
X	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
X	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
X	else # Add other i860-SVR4 vendors below as they are discovered.
X	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
X	fi
X	exit ;;
X    mini*:CTIX:SYS*5:*)
X	# "miniframe"
X	echo m68010-convergent-sysv
X	exit ;;
X    mc68k:UNIX:SYSTEM5:3.51m)
X	echo m68k-convergent-sysv
X	exit ;;
X    M680?0:D-NIX:5.3:*)
X	echo m68k-diab-dnix
X	exit ;;
X    M68*:*:R3V[5678]*:*)
X	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
X    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
X	OS_REL=''
X	test -r /etc/.relid \
X	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
X	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
X	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
X	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
X	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
X    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
X	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
X	  && { echo i486-ncr-sysv4; exit; } ;;
X    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
X	OS_REL='.3'
X	test -r /etc/.relid \
X	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
X	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
X	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
X	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
X	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
X	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
X	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
X    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
X	echo m68k-unknown-lynxos${UNAME_RELEASE}
X	exit ;;
X    mc68030:UNIX_System_V:4.*:*)
X	echo m68k-atari-sysv4
X	exit ;;
X    TSUNAMI:LynxOS:2.*:*)
X	echo sparc-unknown-lynxos${UNAME_RELEASE}
X	exit ;;
X    rs6000:LynxOS:2.*:*)
X	echo rs6000-unknown-lynxos${UNAME_RELEASE}
X	exit ;;
X    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
X	echo powerpc-unknown-lynxos${UNAME_RELEASE}
X	exit ;;
X    SM[BE]S:UNIX_SV:*:*)
X	echo mips-dde-sysv${UNAME_RELEASE}
X	exit ;;
X    RM*:ReliantUNIX-*:*:*)
X	echo mips-sni-sysv4
X	exit ;;
X    RM*:SINIX-*:*:*)
X	echo mips-sni-sysv4
X	exit ;;
X    *:SINIX-*:*:*)
X	if uname -p 2>/dev/null >/dev/null ; then
X		UNAME_MACHINE=`(uname -p) 2>/dev/null`
X		echo ${UNAME_MACHINE}-sni-sysv4
X	else
X		echo ns32k-sni-sysv
X	fi
X	exit ;;
X    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
X			# says <Richard.M.Bartel@ccMail.Census.GOV>
X	echo i586-unisys-sysv4
X	exit ;;
X    *:UNIX_System_V:4*:FTX*)
X	# From Gerald Hewes <hewes@openmarket.com>.
X	# How about differentiating between stratus architectures? -djm
X	echo hppa1.1-stratus-sysv4
X	exit ;;
X    *:*:*:FTX*)
X	# From seanf@swdc.stratus.com.
X	echo i860-stratus-sysv4
X	exit ;;
X    i*86:VOS:*:*)
X	# From Paul.Green@stratus.com.
X	echo ${UNAME_MACHINE}-stratus-vos
X	exit ;;
X    *:VOS:*:*)
X	# From Paul.Green@stratus.com.
X	echo hppa1.1-stratus-vos
X	exit ;;
X    mc68*:A/UX:*:*)
X	echo m68k-apple-aux${UNAME_RELEASE}
X	exit ;;
X    news*:NEWS-OS:6*:*)
X	echo mips-sony-newsos6
X	exit ;;
X    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
X	if [ -d /usr/nec ]; then
X		echo mips-nec-sysv${UNAME_RELEASE}
X	else
X		echo mips-unknown-sysv${UNAME_RELEASE}
X	fi
X	exit ;;
X    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
X	echo powerpc-be-beos
X	exit ;;
X    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
X	echo powerpc-apple-beos
X	exit ;;
X    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
X	echo i586-pc-beos
X	exit ;;
X    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
X	echo i586-pc-haiku
X	exit ;;
X    SX-4:SUPER-UX:*:*)
X	echo sx4-nec-superux${UNAME_RELEASE}
X	exit ;;
X    SX-5:SUPER-UX:*:*)
X	echo sx5-nec-superux${UNAME_RELEASE}
X	exit ;;
X    SX-6:SUPER-UX:*:*)
X	echo sx6-nec-superux${UNAME_RELEASE}
X	exit ;;
X    SX-7:SUPER-UX:*:*)
X	echo sx7-nec-superux${UNAME_RELEASE}
X	exit ;;
X    SX-8:SUPER-UX:*:*)
X	echo sx8-nec-superux${UNAME_RELEASE}
X	exit ;;
X    SX-8R:SUPER-UX:*:*)
X	echo sx8r-nec-superux${UNAME_RELEASE}
X	exit ;;
X    Power*:Rhapsody:*:*)
X	echo powerpc-apple-rhapsody${UNAME_RELEASE}
X	exit ;;
X    *:Rhapsody:*:*)
X	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
X	exit ;;
X    *:Darwin:*:*)
X	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
X	case $UNAME_PROCESSOR in
X	    i386)
X		eval $set_cc_for_build
X		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
X		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
X		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
X		      grep IS_64BIT_ARCH >/dev/null
X		  then
X		      UNAME_PROCESSOR="x86_64"
X		  fi
X		fi ;;
X	    unknown) UNAME_PROCESSOR=powerpc ;;
X	esac
X	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
X	exit ;;
X    *:procnto*:*:* | *:QNX:[0123456789]*:*)
X	UNAME_PROCESSOR=`uname -p`
X	if test "$UNAME_PROCESSOR" = "x86"; then
X		UNAME_PROCESSOR=i386
X		UNAME_MACHINE=pc
X	fi
X	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
X	exit ;;
X    *:QNX:*:4*)
X	echo i386-pc-qnx
X	exit ;;
X    NEO-?:NONSTOP_KERNEL:*:*)
X	echo neo-tandem-nsk${UNAME_RELEASE}
X	exit ;;
X    NSE-?:NONSTOP_KERNEL:*:*)
X	echo nse-tandem-nsk${UNAME_RELEASE}
X	exit ;;
X    NSR-?:NONSTOP_KERNEL:*:*)
X	echo nsr-tandem-nsk${UNAME_RELEASE}
X	exit ;;
X    *:NonStop-UX:*:*)
X	echo mips-compaq-nonstopux
X	exit ;;
X    BS2000:POSIX*:*:*)
X	echo bs2000-siemens-sysv
X	exit ;;
X    DS/*:UNIX_System_V:*:*)
X	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
X	exit ;;
X    *:Plan9:*:*)
X	# "uname -m" is not consistent, so use $cputype instead. 386
X	# is converted to i386 for consistency with other x86
X	# operating systems.
X	if test "$cputype" = "386"; then
X	    UNAME_MACHINE=i386
X	else
X	    UNAME_MACHINE="$cputype"
X	fi
X	echo ${UNAME_MACHINE}-unknown-plan9
X	exit ;;
X    *:TOPS-10:*:*)
X	echo pdp10-unknown-tops10
X	exit ;;
X    *:TENEX:*:*)
X	echo pdp10-unknown-tenex
X	exit ;;
X    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
X	echo pdp10-dec-tops20
X	exit ;;
X    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
X	echo pdp10-xkl-tops20
X	exit ;;
X    *:TOPS-20:*:*)
X	echo pdp10-unknown-tops20
X	exit ;;
X    *:ITS:*:*)
X	echo pdp10-unknown-its
X	exit ;;
X    SEI:*:*:SEIUX)
X	echo mips-sei-seiux${UNAME_RELEASE}
X	exit ;;
X    *:DragonFly:*:*)
X	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
X	exit ;;
X    *:*VMS:*:*)
X	UNAME_MACHINE=`(uname -p) 2>/dev/null`
X	case "${UNAME_MACHINE}" in
X	    A*) echo alpha-dec-vms ; exit ;;
X	    I*) echo ia64-dec-vms ; exit ;;
X	    V*) echo vax-dec-vms ; exit ;;
X	esac ;;
X    *:XENIX:*:SysV)
X	echo i386-pc-xenix
X	exit ;;
X    i*86:skyos:*:*)
X	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
X	exit ;;
X    i*86:rdos:*:*)
X	echo ${UNAME_MACHINE}-pc-rdos
X	exit ;;
X    i*86:AROS:*:*)
X	echo ${UNAME_MACHINE}-pc-aros
X	exit ;;
esac
X
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
X
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
X  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
X     I don't know....  */
X  printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
X  printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
X	"4"
#else
X	""
#endif
X	); exit (0);
#endif
#endif
X
#if defined (__arm) && defined (__acorn) && defined (__unix)
X  printf ("arm-acorn-riscix\n"); exit (0);
#endif
X
#if defined (hp300) && !defined (hpux)
X  printf ("m68k-hp-bsd\n"); exit (0);
#endif
X
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
X  int version;
X  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
X  if (version < 4)
X    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
X  else
X    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
X  exit (0);
#endif
X
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
X  printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
X  printf ("ns32k-encore-mach\n"); exit (0);
#else
X  printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
X
#if defined (__386BSD__)
X  printf ("i386-pc-bsd\n"); exit (0);
#endif
X
#if defined (sequent)
#if defined (i386)
X  printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
X  printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
X
#if defined (_SEQUENT_)
X    struct utsname un;
X
X    uname(&un);
X
X    if (strncmp(un.version, "V2", 2) == 0) {
X	printf ("i386-sequent-ptx2\n"); exit (0);
X    }
X    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
X	printf ("i386-sequent-ptx1\n"); exit (0);
X    }
X    printf ("i386-sequent-ptx\n"); exit (0);
X
#endif
X
#if defined (vax)
# if !defined (ultrix)
#  include <sys/param.h>
#  if defined (BSD)
#   if BSD == 43
X      printf ("vax-dec-bsd4.3\n"); exit (0);
#   else
#    if BSD == 199006
X      printf ("vax-dec-bsd4.3reno\n"); exit (0);
#    else
X      printf ("vax-dec-bsd\n"); exit (0);
#    endif
#   endif
#  else
X    printf ("vax-dec-bsd\n"); exit (0);
#  endif
# else
X    printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
X
#if defined (alliant) && defined (i860)
X  printf ("i860-alliant-bsd\n"); exit (0);
#endif
X
X  exit (1);
}
EOF
X
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
X	{ echo "$SYSTEM_NAME"; exit; }
X
# Apollos put the system type in the environment.
X
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
X
# Convex versions that predate uname can use getsysinfo(1)
X
if [ -x /usr/convex/getsysinfo ]
then
X    case `getsysinfo -f cpu_type` in
X    c1*)
X	echo c1-convex-bsd
X	exit ;;
X    c2*)
X	if getsysinfo -f scalar_acc
X	then echo c32-convex-bsd
X	else echo c2-convex-bsd
X	fi
X	exit ;;
X    c34*)
X	echo c34-convex-bsd
X	exit ;;
X    c38*)
X	echo c38-convex-bsd
X	exit ;;
X    c4*)
X	echo c4-convex-bsd
X	exit ;;
X    esac
fi
X
cat >&2 <<EOF
$0: unable to guess system type
X
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
X
X  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
X  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
X
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
X
config.guess timestamp = $timestamp
X
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
X
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
X
hostinfo               = `(hostinfo) 2>/dev/null`
/bin/universe          = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch              = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
X
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM  = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
X
exit 1
X
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
SHAR_EOF

# Order of the sed expressions is important.
# We remove the OS version numbers in many cases because they just cause
# questions.  Exceptions are where we maintain several versions.
OS=`sh /tmp/gnu-os$$ | 
    sed -e 's/i[3456789]86-/x86-/' \
	-e 's/-[a-zA-Z0-9]*-/-/' \
	-e s/_BETA_1274425944// \
	-e s/hppa64/hppa/ \
	-e s/hppa2.0/hppa/ \
	-e s/powerpc-darwin.*/powerpc-macosx/ \
	-e s/x86-darwin.*/x86-macosx/ \
	-e s/x86_64-darwin.*/x86_64-macosx/ \
	-e s/sparc64-/sparc-/ \
	-e s/openbsd.../openbsd/ \
	-e s/netbsdelf/netbsd/ \
	-e s/netbsd.*/netbsd/ \
	-e s/freebsd2.*/freebsd2/ \
	-e s/freebsd3.*/freebsd3/ \
	-e s/freebsd4.*/freebsd4/ \
	-e s/freebsd5.*/freebsd5/ \
	-e s/freebsd6.*/freebsd6/ \
	-e s/freebsd7.*/freebsd7/ \
	-e s/hppaw/hppa/ \
	-e s/hpux11.*/hpux11/ \
	-e s/hpux10.*/hpux10/ \
	-e s/mips-irix6.5/mips-irix/ \
	-e s/powerpc-aix.*/powerpc-aix/ \
	-e s/x86-sco.*/x86-sco/ \
	-e s/solaris2.*/solaris/ \
	-e s/alphaev56/alpha/ \
	-e s/osf5.1/tru64/ \
	-e s/cygwin/win32/ \
	-e s/mingw32/win32/ \
	-e s/armv4l/arm/ \
	-e s/linux-gnu/linux/ \
	-e 's/\./_/g'`

rm -f /tmp/gnu-os$$

case $OS in
    *linux*)
	test -z "$BK_STATIC" || {
		echo $OS | sed s/linux/static-linux/
		exit 0
	}
	if [ -d /lib/x86_64-linux-gnu ]
	then	LIBC=`ls /lib/x86_64-linux-gnu/libc-* 2> /dev/null`
	fi
	if [ ! -n "$LIBC" -a -d /lib/i386-linux-gnu ]
	then    LIBC=`ls /lib/i386-linux-gnu/libc-* 2> /dev/null`
	fi
	if [ -n "$LIBC" ]
	then	: # do nothing
	elif [ -d /lib64 ]
	then	LIBC=`ls /lib64/libc-* 2> /dev/null`
	else	LIBC=`ls /lib/libc-* 2> /dev/null`
	fi
	LIBC=`echo $LIBC | \
	    sed -n 's/.*\/libc-\([2-9]\)\.\([0-9][0-9]*\)\..*/glibc\1\2/p' -`
	case "$LIBC" in
	    glibc*)
		echo $OS | sed s/linux/$LIBC-linux/;;
	    *)
		echo $OS | sed s/linux/unknown-linux/;;
	esac
	exit 0
	;;

    "")
	# Hail Mary, full of grace.  Try to get something.
	OS=`uname -m | sed 's/i[3456789]86/x86/'`-`uname -s``uname -r`
	;;
esac
test -z "$BK_STATIC" || OS="static-$OS"
echo $OS
